MCURVE Trading Bot

Client Setup & Execution Instructions

Welcome to the Full Version of the MCurve Bot. Follow these simple instructions to deploy the engine on your computer.

⚙️ STEP 1: PREPARE & INSTALL

Before booting the bot, you need to prepare your license file and install the Cloudflare Tunnel.

  1. Prepare your folder: Unzip the download file onto your Desktop. It contains everything you need.
  2. Configure your Credentials: Open the env.txt file in Notepad (Windows) or TextEdit (Mac) and fill in your details:
    (Note: Your unique LICENSE_KEY was automatically generated and emailed to you the moment you purchased your Tier!) LICENSE_KEY=your_license_key_here
    PROJECTX_USERNAME=your_topstep_username_here
    PROJECTX_API_KEY=your_topstep_api_key_here
    PROJECTX_ACCOUNT_ID=your_topstep_account_id_here
    WEBHOOK_SECRET=make_up_a_secure_password_here
    DASHBOARD_USER=mcurve
    DASHBOARD_PASSWORD=sovereign
    PROJECTX_WS_URL=https://rtc.topstepx.com/hubs/user
    PROJECTX_WS_HUB=TradingHub
  3. *Note on WEBHOOK_SECRET: This is NOT a Gmail password! Simply make up any random word (e.g., my_secret_99). Its only purpose is to act as a custom lock so random people on the internet cannot send fake signals to your bot.
  4. Save your changes! Press Ctrl+S (Windows) or Cmd+S (Mac) to save the file, then close it.
  5. Install Cloudflare: Download and install cloudflared from the official Cloudflare website.
    • Mac Users: Install via Homebrew (brew install cloudflare/cloudflare/cloudflared) or download the MacOS binary.
    • Windows Users: Download the .msi installer and run it.

🚀 STEP 2: BOOT THE ENGINE & CLOUDFLARE

We have completely automated the startup process for you. You no longer need to type commands manually!

For Mac Users:

  1. Because we do not use Apple's corporate tracking certificates, Apple will flag the bot as an "Unidentified Developer". To bypass this, follow these exact steps:
    • Open your Mac Terminal.
    • Type cd (make sure there is a space after cd).
    • Drag and drop your newly unzipped bot folder into the terminal window and hit Enter.
    • Run the Apple quarantine bypass command (and hit Enter):
      xattr -cr MCurveBot-Mac Start-MCurve.command
  2. Now, simply double-click the Start-MCurve.command file inside the folder!
  3. It will instantly pop open two separate terminal windows (One running your MCurve Engine, and one running your Cloudflare Tunnel).

For Windows Users:

  1. Simply double-click the Start-MCurve.bat file!
  2. It will instantly pop open two separate command prompt windows (One running your MCurve Engine, and one running your Cloudflare Tunnel).

⚠️ CRITICAL: Leave BOTH of these black windows open in the background! If you close them, the bot will die and signals will fail.

💎 PREFER A HANDS-FREE SETUP?

Setting up a permanent Cloudflare tunnel requires a few technical steps (purchasing a domain and configuring DNS). If you prefer not to handle the technical server configuration yourself, we offer a White-Glove Remote Installation.

For a one-time fee of $499, our engineering team will securely connect to your machine via TeamViewer (no phone call required) and professionally configure your permanent Cloudflare tunnel. A permanent tunnel is lightning-fast, never expires, and runs invisibly in the background so you never have to launch a Cloudflare terminal again. It provides the ultimate, lag-free mobile dashboard experience from any cell network in the world.

🔒 Absolute Privacy Guarantee

We operate on a strict Zero-Trust policy. During the 45 to 60-minute setup, you remain at your computer. Whenever it is time to enter your personal passwords, broker logins, or payment information for the Cloudflare domain, the technician will instruct you to take over the keyboard while we pause the screen. We will never ask for or see your private credentials.

Contact Support to Book Installation

🔗 STEP 3: LINK TO TRADINGVIEW

  1. Open TradingView to create your alert.
  2. In the "Webhook URL" box, paste your Cloudflare link and append /webhook/tradingview?secret=YOUR_WEBHOOK_SECRET.
  3. (Note: Use the exact Webhook Secret you created in Step 1!)

    Your final URL should look exactly like this:
    https://[random-words].trycloudflare.com/webhook/tradingview?secret=my_custom_secret

🖥️ STEP 4: OPEN YOUR TRADING DASHBOARD

Now that your MCurve Engine is running in the background, you can access your beautiful local Trading Dashboard!

  1. Open your favorite web browser (Chrome, Safari, Edge, etc.).
  2. In the URL address bar, type exactly: http://localhost:3000 and hit Enter.
  3. You will be prompted to log in. By default, your credentials are:
    • Username: mcurve
    • Password: sovereign
    (Note: You can change these to a custom password anytime by editing the DASHBOARD_USER and DASHBOARD_PASSWORD lines in your env.txt file and restarting the bot!)
  4. You will instantly see your live PnL, active trades, and Strategy controls!

📱 STEP 5: REMOTE ACCESS (MONITOR FROM ANYWHERE)

Want to monitor your trades from your phone while away from your computer? You have two reliable options:

  1. Option 1: The Cloudflare Tunnel (Recommended)
    Because you set up a Cloudflare Tunnel for TradingView, that same tunnel acts as a secure gateway to your dashboard. Simply open your phone's web browser, go to your custom Cloudflare URL (e.g., https://yourdomain.com), and log in with your dashboard credentials. You can view positions and hit the kill switch from anywhere in the world!
  2. Option 2: Tailscale VPN (Advanced Privacy)
    Note: You still need a custom domain and Cloudflare for TradingView to send alerts to your bot. However, if you are extremely security-conscious and do not want your personal Trading Dashboard exposed on your public Cloudflare domain (even though it is password protected), you can use firewall rules to block public access to the dashboard. You can then install the free Tailscale VPN app to create an invisible backdoor. Once connected to the same Tailscale network, you simply type your computer's private Tailscale IP address into your phone's browser (e.g., http://100.x.x.x:3000) to access the dashboard privately.

🛑 CRITICAL OPERATIONAL RULES (MUST READ)

To prevent API bans, missed trades, and system desyncs, you must adhere to these three rules at all times:

  1. The Throttling Issue (the Broker App vs. The Bot):
    When the bot is running, it manages your bracket orders directly. If you have the the Broker web app open and you manually close a trade there, the bot instantly detects the position mismatch, panics, and rapid-fires cancel requests to flatten the remaining orders. This burst triggers the Broker's rate limits. Solution: As long as you let the bot manage the exits (or use the bot's red KILL SWITCH to flatten), having the the Broker app open just to watch is completely fine.
  2. Rapid Restarts & API Bans:
    When you start the bot, it has to instantly download your account balance, active positions, daily loss limits, and bracket states all at once. Doing this multiple times in a 2-minute window makes the Broker's Cloudflare security flag the bot as "spamming," which temporarily locks out your connection. Solution: Once it's running, let it run! Never restart the bot constantly, especially while in an active trade.
  3. TradingView Contract Synchronization:
    You must update TradingView to the active contract. The bot is smart enough to auto-translate your signal into the correct live the Broker contract so the order doesn't fail. However, if your TradingView chart is stuck on an expired contract, the volume dries up and the price gets choppy. Solution: This means your indicators will fire late or at bad prices. Changing TradingView to the live contract guarantees your entry signal fires on true, high-volume price action.

📡 FREQUENTLY ASKED QUESTIONS (ARCHITECTURE)

Why does the Dashboard show "🔵 POLLING ACTIVE" instead of WebSockets?

If you see the blue 🔵 POLLING ACTIVE badge on your dashboard, your bot is functioning 100% perfectly. Here is a breakdown of the three completely different connections so you can see exactly how bulletproof this architecture is:

  1. TradingView Signals (Inbound): TradingView sends your signals through your Cloudflare Tunnel directly into your Mac/PC. This has absolutely nothing to do with the Broker. This is 100% working, which is why your CF TUNNEL badge is Green. You will perfectly receive every TradingView signal!
  2. Placing Trades (Outbound): When the bot receives that TradingView signal, it uses a standard REST API request to send the buy/sell order to the Broker's servers. This is completely unaffected by their WebSocket firewall. The bot will execute the trades flawlessly!
  3. Live Price Updates (the Broker's WebSocket): the Broker's WebSocket is only used for streaming live price ticks. Because standalone compiled applications do not run inside a web browser, the standard WebSocket streaming connection is unsupported. Therefore, your bot intelligently utilizes the REST Polling Engine. This means it simply asks the Broker "What is my balance and position?" every 2 seconds instead of streaming it continuously.

Will the Elastic Profit Guard (EPG) and risk features still work?

Yes! The Elastic Profit Guard (EPG) and all other advanced risk features are 100% functional.

The bot continually polls the Broker to get the live price, calculate the High Water Mark, and mathematically adjust your Trailing Stops. While WebSockets stream data every millisecond, the Polling Engine updates every few seconds. So your EPG trailing stops will absolutely still move and protect your runners, they will just adjust in slight "jumps" (every few seconds) instead of a perfectly smooth curve.

Remember: Because the Broker physically holds your Stop Loss bracket on their own exchange servers, your capital is always completely protected against sudden market crashes, regardless of how fast the bot updates the trailing offset!

You are now fully automated! When your TradingView indicator fires, it will route through Cloudflare directly into your MCurve Engine for lightning-fast execution.